//
// Created by hyh on 4/28/20.
//

#ifndef VIDEOPLAYER_VIDEORECORD_H
#define VIDEOPLAYER_VIDEORECORD_H

#include <Log.h>

static int video_count = 0;
class VideoRecord{
private:
    AVCodecContext *videoContext;
    AVCodec * videoCodec;
    AVFrame * videoFrame;
    AVPacket * videoPacket;
    AVFormatContext * videoFormatContext;
    AVOutputFormat *videoOutputFormat;
    AVStream * videoStream;
    int64_t start_time;
    int FPS=10;
    FILE *f;

    void encode(AVCodecContext *enc_ctx, AVFrame *frame, AVPacket *pkt,FILE *outfile);

public:

    void init(const char * destUrl,int w,int h);
    void encode(uint8_t *data,int len);
    void stop();
};

#endif //VIDEOPLAYER_VIDEORECORD_H
